<style>
.headinfo .child.userinfo .face {
    border: 0.1rem solid #fff; 
}
.bottombg {bottom:-20px;width:100%;height:11rem;border-bottom-right-radius:100% 40px;border-bottom-left-radius:100% 40px;}
.mod-group {
    margin: 0 auto;
	margin-top: 0;
    padding:0.5rem;
}
.fui-icon-group .fui-icon-col-sm {
    margin:10px 0;
}
.subtitle {
    font-size: 0.7rem;
}
.badge {
    left: 2rem;
    top: 0;
}
.fui-page .fui-page-title {
    color:#d9d5ca;
	padding: 0.3rem 0.5rem;
}
.fui-navbar .buybtn  {padding-left:0.3rem;background:#fff}
.fee-tag-nav, .fee-tagup-nav, .fee-disabled-nav {border-radius:1rem;height:2rem;line-height:2rem;color:#fff;width:100%;font-weight:400;font-size:0.7rem;margin:0.2rem 0;padding:0 0.5rem}
.fee-tagup {background:#e7bf82;color:#fff;width:auto;font-weight:400;font-size:0.55rem}
.fee-tag-nav {background:#e7bf82;}
.fee-tagup-nav {background:#e7bf82;}
.fee-disabled-nav {background:#999;}
.fui-tab-scroll .item {
    border: 1px solid #dfdfdf;margin:0.1rem;height:5rem;line-height:1.5rem
}
.fui-tab-scroll .item.on {
    border: 2px solid #e5884b;background:#fdf4ed
}
.fui-icon-group .fui-icon-col-sm .text {
    color: #999;
}
.fui-icon-group .fui-icon-col-sm .icon{background:#f2f2f2;color:#999;}
.fui-icon-group .fui-icon-col-sm.open .text{color:#e7bf82}
.fui-icon-group .fui-icon-col-sm.open .icon{background:#fdf4ed;color:#e7bf82}
</style>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
<div class="fui-content">
		<div class="fe-floatback right" style="top:0.5rem;left:0.5rem">
			<a style="background-color:rgba(255,255,255, 0.5)" ng-click="goback()">
			<i class="icon icon-back"></i>
			</a>
		</div>
		<div class="bottombg" style="background:#332a21;"></div>
		<div class="fui-page-title bold" style='margin-top:-10rem;'>{{pagedata.nowlevel.title}} · VIP</div>
		<div class="fui-page-title bold overflow-h" style='font-size:0.85rem;padding-top:0'>{{pagedata.nowlevel.desc}}</div>
		<div class="fui-page-title bold" style='width:auto' ng-click="pagedata.showsheng_fees=true">
			<div class="btn btn-default btn-banf" style="background-image: linear-gradient(#fee5a5, #eac27c);">开通{{pagedata.nowlevel.title}}可节省<span class="bold">{{pagedata.nowlevel.jie_fee||'0.00'}}</span>/年 ></div>
		</div>
		<div class="mod-group">
			<div class="memlogo-area" style="height:5rem;margin-bottom:0;background:url({{tomedia(pagedata.member.cardbg) || '../core/resource/images/cardbg.png'}}) no-repeat 100%">
                    <div class="memlogo">
                        <img ng-src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/gw-user.png'}}">
                    </div>
                    <div class="name">{{pagedata.member.nickname || '匿名'}}</div>
                    <br>
                    <div class="name">{{pagedata.member.mobile || '无手机号'}}</div>
            </div>
		</div>
		<div class="mod-group" style="margin-top:-1.5rem">
			<div class="radius" style="background: #fff;padding:0.5rem;">
			<div class="fui-tab-scroll" style="background: #fff;padding:0;height:auto">
			<div ng-repeat="item in pagedata.levels" ng-class="{'radius item':1,'on':pagedata.post.level_id==item.id}" ng-click="pagedata.post.level_id=item.id;pagedata.nowlevel=item">
				<div class="bold">{{item.title}}</div>
				<div ng-if="item.up_type==2">￥<span style="font-size:1rem">{{item.open_fee}}</span></div>
				<div ng-if="item.up_type!=2">消费升级</div>
				<div style="color:#e5884b">节省￥{{item.jie_fee}}</div>
			</div>
			</div>
			</div>
		</div>
		<div class="mod-group">
			<div class="fui-icon-group noborder col-4 radius" style="background-color: #fff;padding:0.5rem">
						<div ng-class="{'fui-icon-col-sm external':1,'open':pagedata.nowlevel.isdiscount==1}" style="margin:0">
								<i class="icon icon-dixiaofei bold" style="border-radius:100%;padding:0.2rem;font-size:1.6rem;"></i>
								<div class="text bold">VIP折扣</div>
								<div ng-if="pagedata.nowlevel.isdiscount==1" class="subtitle" style="font-size:0.6rem;color: #666;margin-top:-0.2rem">平均 <span style="color:{{main.syscolor || '#7c1cc9'}}">{{pagedata.nowlevel.discount}}折</span></div>
								<div ng-if="pagedata.nowlevel.isdiscount!=1" class="subtitle" style="font-size:0.6rem;color: #666;margin-top:-0.2rem">未开启</div>
						</div>
						<div ng-class="{'fui-icon-col-sm external':1,'open':pagedata.nowlevel.isvipgoods==1}" style="margin:0">
								<i class="icon icon-shengriliwu bold" style="border-radius:100%;padding:0.2rem;font-size:1.6rem;"></i>
								<div class="text bold">专享商品</div>
								<div ng-if="pagedata.nowlevel.isvipgoods==1" class="subtitle" style="font-size:0.6rem;color: #666;margin-top:-0.2rem">特价 <span style="color:{{main.syscolor || '#7c1cc9'}}">VIP商品</span></div>
								<div ng-if="pagedata.nowlevel.isvipgoods!=1" class="subtitle" style="font-size:0.6rem;color: #666;margin-top:-0.2rem">未开启</div>
						</div>
						<div ng-class="{'fui-icon-col-sm external':1,'open':pagedata.nowlevel.istegoods==1}" style="margin:0">
								<i class="icon icon-tianmaopaidui bold" style="border-radius:100%;padding:0.2rem;font-size:1.6rem;"></i>
								<div class="text bold">特价商品</div>
								<div ng-if="pagedata.nowlevel.istegoods==1" class="subtitle" style="font-size:0.6rem;color: #666;margin-top:-0.2rem">会员特价商品</div>
								<div ng-if="pagedata.nowlevel.istegoods!=1" class="subtitle" style="font-size:0.6rem;color: #666;margin-top:-0.2rem">未开启</div>
						</div>
						<div ng-class="{'fui-icon-col-sm external':1,'open':pagedata.nowlevel.iscoupon==1}" style="margin:0">
								<i class="icon icon-huiyuanqia bold" style="border-radius:100%;padding:0.2rem;font-size:1.6rem;"></i>
								<div class="text bold">赠送优惠券</div>
								<div ng-if="pagedata.nowlevel.iscoupon==1" class="subtitle" style="font-size:0.6rem;color: #666;margin-top:-0.2rem">价值 <span style="color:{{main.syscolor || '#7c1cc9'}}">{{pagedata.nowlevel.coupon_fee || '0.00'}}元</span></div>
								<div ng-if="pagedata.nowlevel.iscoupon!=1" class="subtitle" style="font-size:0.6rem;color: #666;margin-top:-0.2rem">未开启</div>
						</div>
			</div>
		</div>
		<div class="mod-group" style="padding-top:0;margin-bottom:1rem">
			<div class="fixed-title">
				<span class="befirst spacing">
					<span class="icon icon-fengexianzuo" style="font-size:2rem;color:#666"></span>
				 </span> 
				<span class="title-text bold" style="color:#333;line-height:2rem"><i class="icon icon-xiai red" style="font-size:0.8rem;"></i> {{pagedata.nowlevel.title}}特权</span> 
				<span class="spacing">
					 <span class="icon icon-fengexianyou" style="font-size:2rem;color:#666"></span>
				</span>
			</div>
			<div class="fui-cell-group radius" style="padding:0.5rem;">
				<div class="fui-cell" style="padding:0.2rem">
					<div class="fui-cell-info">
						<div class="bold">
						折扣特权
						</div>
						<div class="subtitle">
						平均 <span style="color:{{main.syscolor || '#7c1cc9'}}">{{pagedata.nowlevel.discount}}折</span>，可叠加优惠券！
						</div>
					</div>
					<div class="fui-cell-remark" style='width:auto' ng-click="pagedata.showdiscount=true">
					特权详情
					</div>
				</div>
				<div class="fui-cell" style="padding:0.2rem">
					<div class="fui-cell-info">
						<div class="bold">
						专享商品特权
						</div>
						<div class="subtitle">
						部分商品，只有{{pagedata.nowlevel.title}}才能购买！
						</div>
					</div>
					<div class="fui-cell-remark" style='width:auto' ng-click="pagedata.showgoods=true">
					特权详情
					</div>
				</div>
				<div class="fui-cell" style="padding:0.2rem">
					<div class="fui-cell-info">
						<div class="bold">
						赠送优惠券
						</div>
						<div class="subtitle">
						新增升级，立即赠送价值 <span style="color:{{main.syscolor || '#7c1cc9'}}">{{pagedata.nowlevel.coupon_fee || '0.00'}}元</span>优惠券礼包！
						</div>
					</div>
					<div class="fui-cell-remark" style='width:auto' ng-click="pagedata.showcoupon=true">
					特权详情
					</div>
				</div>
				<div ng-if="pagedata.nowlevel.fan_fee>0" class="fui-cell" style="padding:0.2rem">
					<div class="fui-cell-info">
						<div class="bold">
						会员返现
						</div>
						<div class="subtitle">
						返现总额 <span style="color:{{main.syscolor || '#7c1cc9'}}">{{pagedata.nowlevel.fan_fee || '0.00'}}元</span>
						<span ng-if="pagedata.nowlevel.fan_time>0">升级后消费分{{pagedata.nowlevel.fan_time}}次返</span>
						<span ng-if="pagedata.nowlevel.fan_time<=0">升级后立即全额返</span>！
						</div>
					</div>
				</div>
				<div class="fui-cell" style="padding:0.2rem">
					<div class="fui-cell-info">
						<div class="bold">
						会员收费类型
						</div>
						<div class="subtitle">
						<span ng-if="pagedata.nowlevel.vip_type!=1">按年收费，会员有效期1年</span>
						<span ng-if="pagedata.nowlevel.vip_type==1">一次性收费，升级后永久有效</span>！
						</div>
					</div>
				</div>
			</div>
			<div ng-if="pagedata.nowlevel.up_type!=2" class="fixed-title" style="margin-top:0.5rem">
				<span class="befirst spacing">
					<span class="icon icon-fengexianzuo" style="font-size:2rem;color:#666"></span>
				 </span> 
				<span class="title-text bold" style="color:#333;line-height:2rem"><i class="icon icon-xiai red" style="font-size:0.8rem;"></i> {{pagedata.nowlevel.title}}升级条件</span> 
				<span class="spacing">
					 <span class="icon icon-fengexianyou" style="font-size:2rem;color:#666"></span>
				</span>
			</div>
			<div ng-if="pagedata.nowlevel.up_type!=2 || pagedata.nowlevel.need_buy==1" class="fui-cell-group radius" style="padding:0.5rem;">
				<div ng-if="pagedata.nowlevel.goods_ids.length>0 && pagedata.nowlevel.up_type!=2" class="fui-cell" style="padding:0.2rem">
					<div class='fui-cell-text'>
							购买下面指定商品（任意一个），
							才可成为[<span class="text-danger text-bold">{{pagedata.nowlevel.title}}</span>]
					</div>
				</div>
				<div ng-if="pagedata.nowlevel.goods_ids.length>0 && pagedata.nowlevel.up_type!=2" class="fui-goods-group no" style="padding:0;background-color:#f7f7f7">
					<div ng-repeat="item in pagedata.nowlevel.goods_ids" class="fui-goods-item" style="padding:0;margin:0.2rem 0;border: 0px solid #e7e7e7;">
						<div ng-click="access_json('jy_weishop/goods.detail//id='+item.id);" class="image" style="background-image: url({{tomedia(item.image) ||'../core/resource/images/nopic.jpg'}})">
						</div>
						<div class="detail" style="height:2.6rem;padding-left:0.3rem;padding-top:0.2rem">
							<div ng-click="access_json('jy_weishop/goods.detail//id='+item.id);" class="overflow-h" style="width:10rem">
									{{item.title}}
							</div>
							<div>
								<div class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">{{item.merchname || '平台直营'}}</div>
								<div class="price red" style="margin-top:0.1rem">
									<span class="text">
										<span style="font-weight:bold;font-size:0.8rem;">￥ {{item.price}}</span>
									</span>
									<span class="red" style="padding-right:0.5rem" href="javascript:" ng-click="access_json('jy_weishop/goods.detail//id='+item.id);"><i class="icon icon-tianmaochaoshigouwuche"></i></span>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div ng-if="pagedata.nowlevel.ordermoney>0" class="fui-cell" style="padding:0.2rem">
					<div class='fui-cell-text'>
							本店累计消费满 <span class="text-danger text-bold">￥{{pagedata.nowlevel.ordermoney}}</span>，
							才可成为[<span class="text-danger text-bold">{{pagedata.nowlevel.title}}</span>]，您已消费 <span class="text-danger text-bold">￥{{pagedata.data.isordermoney}}</span>
							<span ng-if="pagedata.nowlevel.ordermoney>pagedata.data.isordermoney">，请继续努力</span>！
					</div>
				</div>
				<div ng-if="pagedata.nowlevel.ordercount>0 && pagedata.nowlevel.up_type!=2" class="fui-cell" style="padding:0.2rem">
					<div class='fui-cell-text'>
							本店累计消费满 <span class="text-danger text-bold">{{pagedata.nowlevel.ordercount}}</span>次，
							才可成为[<span class="text-danger text-bold">{{pagedata.nowlevel.title}}</span>]，您已消费 <span class="text-danger text-bold">{{pagedata.data.isordercount}}</span>次
							<span ng-if="pagedata.nowlevel.ordercount>pagedata.data.isordercount">，请继续努力</span>！
					</div>
				</div>
			</div>
			<div ng-if="pagedata.nowlevel.content" class="fui-cell-group radius" style="padding:0.5rem;">
				<div class="fui-article-content" ng-bind-html="trust(pagedata.nowlevel.content)"></div>
			</div>
		</div>
		<div class="fui-navbar-tip overflow-h" style="bottom:2.8rem">{{pagedata.nowlevel.desc || '现在升级，享受折扣优惠！'}}</div>
		<div class="fui-navbar" style="height:2.8rem">
			<div class="fui-cell-group" style="padding:0;margin-top:0">
			<div class="fui-cell sm" style="padding:0.2rem">
				<div class="fui-cell-icon" style=''>
				<input type="checkbox" ng-checked="pagedata.post.checked" ng-model="pagedata.post.checked" name="checkbox" class="fui-radio fui-radio-danger cartmode check-item"/>
				</div>
				<div class="fui-cell-text" style='line-height:1.2;font-size:0.7rem'>
					<div class="text">会员用户协议</div>
					<div class="subtitle" style="font-size:0.65rem" ng-click="pagedata.show_xieyi=true;">查看协议详情 <i class="icon icon-tishi" style="font-size:0.65rem"></i></div>
				</div>
				<div class="fui-cell-remark noremark" style='width:auto'>
				<div class="fee-tagup-nav" ng-if="pagedata.nowlevel.up_type==2 && pagedata.nowlevel.canup==1" ng-click="pagedata.buyvip()">
					立即支付￥<span class="bold">{{pagedata.nowlevel.open_fee || '0.00'}}</span>/年
				</div>
				<div class="fee-tagup-nav" ng-if="(pagedata.nowlevel.up_type==3 || pagedata.nowlevel.up_type==4) && pagedata.nowlevel.canup==1" ng-click="pagedata.buyvip()">
					立即充值￥<span class="bold">{{pagedata.nowlevel.open_fee || '0.00'}}</span>{{pagedata.nowlevel.open_feetitle || '余额'}}
				</div>
				<div class="fee-tagup-nav" ng-if="pagedata.nowlevel.up_type<2" ng-click="access_json('jy_weishop/activity//order=upvip')">
					前往购物
				</div>
				<div class="fee-disabled-nav" ng-if="pagedata.nowlevel.up_type>=2 && pagedata.nowlevel.canup!=1">
					还不满足条件
				</div>
				</div>
			</div>
			</div>
		</div>
</div>
</div>
<div ng-if="pagedata.show_xieyi" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" style="font-size:1.2rem;top:105%;" ng-click="pagedata.show_xieyi=false"></i>
			<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">{{pagedata.xieyi.title||'会员用户协议'}} / <small>Read Ggree</small></div>
					<div class="text" style="padding-top:0.5rem;font-size:0.7rem" ng-bind-html="trust(pagedata.xieyi.content)">
					</div>
			</div>
			<div class="modal-footer">
				<div ng-click="pagedata.show_xieyi=false;pagedata.post.checked=true" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showsheng_fees" class="popup">
    <div class="popup-body">
		<div class="popup-center" style="width:80%">
			<i class="closed icon icon-cuowu" style="font-size:1.2rem;top:105%;" ng-click="pagedata.showsheng_fees=false"></i>
			<div class="fui-page-title red bold" style="margin-top:0.5rem">{{pagedata.nowlevel.title}}VIP福利</div>
			<div class="fui-page-subtitle">{{pagedata.nowlevel.desc}}</div>
			<div class="fui-cell-group" style="height:11rem;overflow-y:scroll;margin-bottom:0.5rem">
					<div class="fui-cell bold">			
						<div class="fui-cell-info">
							{{pagedata.nowlevel.title}}VIP平均可省
						</div>
						<div class="fui-list-remark">
							<span style="color:red;font-size:0.8rem">￥{{pagedata.nowlevel.jie_fee || '0.00'}}/年</span>
						</div>
					</div>
					<div ng-repeat="item in pagedata.nowlevel.sheng_fees" class="fui-cell">			
						<div class="fui-cell-info">
							 {{item.title}}
						</div>
						<div class="fui-list-remark">
							-￥{{item.fee}}
						</div>
					</div>
			</div>
		</div>
	 </div>
</div>
<div ng-if="pagedata.showdiscount" class="popup">
    <div class="popup-body">
		<div class="popup-center" style="width:80%">
			<i class="closed icon icon-cuowu" style="font-size:1.2rem;top:105%;" ng-click="pagedata.showdiscount=false"></i>
			<div class="fui-page-title red bold" style="margin-top:0.5rem">{{pagedata.nowlevel.title}}VIP折扣</div>
			<div class="fui-page-subtitle">{{pagedata.nowlevel.desc}}</div>
			<div class="fui-cell-group" style="height:10rem;overflow-y:scroll;margin-bottom:0.5rem">
					<div class="fui-cell bold">			
						<div class="fui-cell-info c">
							VIP期间购买商品享受
						</div>
					</div>
					<div class="fui-cell bold">			
						<div class="fui-cell-info c">
							<span style="color:red;font-size:0.8rem">{{pagedata.nowlevel.discount || '0'}}折</span>
						</div>
					</div>
			</div>
		</div>
	 </div>
</div>
<div ng-if="pagedata.showgoods" class="popup">
    <div class="popup-body">
		<div class="popup-center" style="width:80%">
			<i class="closed icon icon-cuowu" style="font-size:1.2rem;top:105%;" ng-click="pagedata.showgoods=false"></i>
			<div class="fui-page-title red bold" style="margin-top:0.5rem">{{pagedata.nowlevel.title}}VIP特权商品</div>
			<div class="fui-page-subtitle">{{pagedata.nowlevel.desc}}</div>
			<div class="fui-cell-group" style="height:10rem;overflow-y:scroll;margin-bottom:0.5rem">
					<div class="fui-cell bold">			
						<div class="fui-cell-info c">
							VIP期间购买《特权商品》
						</div>
					</div>
					<div class="fui-cell bold">			
						<div class="fui-cell-info c">
							<span style="color:red;font-size:0.8rem">平均可省￥{{pagedata.nowlevel.jie_fee || '0'}}/年</span>
						</div>
					</div>
			</div>
		</div>
	 </div>
</div>
<div ng-if="pagedata.showcoupon" class="popup">
    <div class="popup-body">
		<div class="popup-center" style="width:80%">
			<i class="closed icon icon-cuowu" style="font-size:1.2rem;top:105%;" ng-click="pagedata.showcoupon=false"></i>
			<div class="fui-page-title red bold" style="margin-top:0.5rem">{{pagedata.nowlevel.title}}VIP特权商品</div>
			<div class="fui-page-subtitle">{{pagedata.nowlevel.desc}}</div>
			<div class="fui-cell-group" style="height:10rem;overflow-y:scroll;margin-bottom:0.5rem">
					<div class="fui-cell bold">			
						<div class="fui-cell-info c">
							开通VIP赠送优惠券
						</div>
					</div>
					<div class="fui-cell bold">			
						<div class="fui-cell-info c">
							<span style="color:red;font-size:0.8rem">价值：￥{{pagedata.nowlevel.coupon_fee || '0'}}元</span>
						</div>
					</div>
			</div>
		</div>
	 </div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
//购买
scope.pagedata.buyvip=function(){
	if(!scope.pagedata.post.checked){
		scope.message('请先阅读并勾选《会员协议》','error');
		return false;
	}
	if(scope.pagedata.nowid[scope.pagedata.post.level_id]>0){
		scope.post_json('jy_weishop/member.open/pay/id='+scope.pagedata.nowid[scope.pagedata.post.level_id],{},function(pay_id){
			scope.tool.pay(pay_id,function(res){
					console.log('收到支付结果！');
					if(res.type=='success'){
						scope.message('升级成功！','',scope.pagedata.homeaction);
					}else{
						scope.message('升级失败！'+res.message);
					}
			},'','',scope.pagedata.homeaction);
		});
	}else{
		scope.post_json('jy_weishop/member.open/post/',scope.pagedata.post,function(res){
			console.log('pay_id');console.log(res);
			scope.pagedata.nowid[scope.pagedata.post.level_id]=res.order_id
			scope.$evalAsync();
			scope.tool.pay(res.pay_id,function(res){
					console.log('收到支付结果！');
					if(res.type=='success'){
						scope.message('升级成功！','',scope.pagedata.homeaction);
					}else{
						scope.message('升级失败！'+res.message);
					}
			},'','',scope.pagedata.homeaction);
		});
	}
}
</script>